<div class="col-lg-12">
    <h1 class="page-header">Bản tin điện tử</h1>
</div>
<div class="col-lg-12">
    <a href="<?php echo Yii::app()->createUrl('newsletter/add')?>" class="btn btn-success margin-20">Thêm bản tin điện tử >> </a>
    
</div>
<div class="col-lg-12">
    <table class="items table table-bordered">
        <tr style="background: #428bca;color: #fff">
            <th width="100px">#</th>
            <th>tiêu đề</th>
            <th>ngày tạo</th>
            <th style="text-align: center">Gửi mail</th>
            <th style="text-align: center">Sửa</th>
            <th style="text-align: center">Xóa</th>
        </tr>
        
        <?php foreach ($newsletters as $mail): ?>
            <tr>
                <td>
                    <?php echo $mail->id ?>
                </td>
                <td>
                    <?php echo $mail->title ?>
                </td>
                <td>
                    <?php echo date('d-m-Y', strtotime($mail->created)) ?>
                </td>
                <td style="text-align: center">
                    <a class="send mail" title="" data-toggle="tooltip" href="<?php echo Yii::app()->createUrl('newsletter/send', array('id' => $mail->id)) ?>" data-original-title="Delete">
                        <i class="glyphicon glyphicon-envelope"></i>
                    </a>
                </td>
                <td style="text-align: center">
                    <a class="update" title="" data-toggle="tooltip" href="<?php echo Yii::app()->createUrl('newsletter/update', array('id' => $mail->id)) ?>" data-original-title="update">
                        <i class="glyphicon glyphicon-pencil"></i>
                    </a>
                </td>
                <td style="text-align: center">
                    <a class="delete" title="" data-toggle="tooltip" href="<?php echo Yii::app()->createUrl('newsletter/delete', array('id' => $mail->id)) ?>" data-original-title="Delete">
                        <i class="glyphicon glyphicon-trash"></i>
                    </a>
                </td>
            </tr>
        <?php endforeach; ?>
    </table>
</div>